﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Common;
using System.Data;

namespace Runda.CMS.Dal
{
    public partial class CtrtContractPaymentDal
    {
        public decimal GetContractPayment(Guid ContractID)
        {
            string sql = @"select isnull(sum(PayAmount),0) from Cms_Ctrt_ContractPayment where ContractID = @ContractID";

            DbCommand dbcommand = CurrentDatabase.GetSqlStringCommand(sql);
            CurrentDatabase.AddInParameter(dbcommand, "@ContractID", DbType.Guid, ContractID);
            return (decimal)CurrentDatabase.ExecuteScalar(dbcommand);
        }
    }
}
